FROM openjdk:8-jre-alpine

LABEL maintainer="tan.yi1993@163.com" \
    description="基于openjava1.8的nacos-server"

WORKDIR /root/

ENV NACOS_VERSION=0.7.0 MODE=standalone

RUN wget https://github.com/alibaba/nacos/releases/download/${NACOS_VERSION}/nacos-server-${NACOS_VERSION}.tar.gz && \
    tar -zxvf nacos-server-${NACOS_VERSION}.tar.gz && \
    rm -rf nacos-server-${NACOS_VERSION}.tar.gz && \
    mkdir -p nacos/logs && \
    cd nacos/logs && \
    touch start.out &&\
    ln -sf /dev/stdout /root/nacos/logs/start.out && \
    ln -sf /dev/stderr /root/nacos/logs/start.out && \
    rm -rf /root/nacos/bin/startup.sh

COPY startup.sh /root/nacos/bin/startup.sh

VOLUME /root/nacos/logs

EXPOSE 8848

ENTRYPOINT sh /root/nacos/bin/startup.sh